package com.zhong.gang.applib.http;


import com.zhong.gang.applib.http.builder.GetBuilder;
import com.zhong.gang.applib.http.builder.PostFormBuilder;
public class HttpUtils {

    public static PostFormBuilder post(String url,boolean isLogin,String token,String roleID,String userID){
        PostFormBuilder builder = OkHttpUtils.post().url(url);
        if (isLogin)
            builder.addHeader("X-HEADER-TOKEN", token)
                .addHeader("X-HEADER-ROLE-ID", roleID+"")
                .addHeader("X-HEADER-USER-ID", userID+"");
        return builder;
    }

    public static GetBuilder get(String url,boolean isLogin,String token,String roleID,String userID){
        GetBuilder builder = OkHttpUtils.get().url(url);
        if (isLogin)
            builder.addHeader("X-HEADER-TOKEN",token)
                    .addHeader("X-HEADER-ROLE-ID", roleID)
                    .addHeader("X-HEADER-USER-ID", userID);
        return builder;
    }
}
